Skip to content

feat(editor): togglable visual line break marker#2133

Open
Elitex07 wants to merge 13 commits into
Acode-Foundation:mainfrom
Elitex07:feature/line-break-marker
Open

feat(editor): togglable visual line break marker#2133
Elitex07 wants to merge 13 commits into
Acode-Foundation:mainfrom
Elitex07:feature/line-break-marker

Conversation

@Elitex07
Copy link
Copy Markdown

This pull request introduces a new feature that allows users to display visual markers for line breaks in the editor when text wrapping is enabled. It also includes updates to the development container configuration and Gradle build toolchain settings. The most significant changes are grouped below:

Editor Feature: Line Break Marker

  • Added a new CodeMirror plugin (lineBreakMarker) in src/cm/lineBreakMarker.ts that visually marks line breaks with a "¬" character.
  • Integrated the line break marker feature into the editor manager (src/lib/editorManager.js), including compartment management, settings application, and event handling for toggling the marker. [1] [2] [3] [4]
  • Added a new setting showLineBreakMarker to the default editor settings and the editor settings UI, allowing users to enable or disable the feature. [1] [2]
  • Updated the English language strings to include the new setting label.

Development Environment and Build Tooling

  • Added .devcontainer/devcontainer-lock.json to lock Node.js and Android SDK versions for the development container.
  • Added gradle/gradle-daemon-jvm.properties and updated settings.gradle to configure Gradle toolchains using the Foojay resolver convention plugin. [1] [2]
  • Added local.properties for local Android SDK configuration (note: this file should not be version controlled).

@github-actions github-actions Bot added enhancement New feature or request translations Anything related to Translations Whether a Issue or PR labels May 25, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 25, 2026

Greptile Summary

This PR adds a toggleable "show line break marker" feature that renders a "¬" glyph at the end of each non-final document line in CodeMirror when both the new setting and text wrapping are active. Supporting changes include devcontainer/Gradle toolchain configs and translation string additions across all locale files.

  • src/cm/lineBreakMarker.ts: New ViewPlugin using widget decorations; the getDecorations method accumulates ranges into a plain array before calling Decoration.set, which can produce duplicate entries when a long document line spans two visible ranges — replace with RangeSetBuilder for robustness.
  • src/lib/editorManager.js: Compartment is correctly keyed on both showLineBreakMarker and textWrap, so toggling either setting properly enables/disables the markers without an extra listener.
  • src/lang/*.json / index.d.ts: Both the label and info-text keys are present in en-us.json and the TypeScript declarations; other locale files carry English placeholder strings consistent with this project's pattern.

Confidence Score: 4/5

Safe to merge after addressing the RangeSetBuilder refactor in the new plugin file; all other changes are additive and low-risk.

The core editor integration in editorManager.js is solid — compartment keying and listener wiring are correct. The only concern is in lineBreakMarker.ts: iterating visible ranges with a plain array can add duplicate widget decorations at the same position when a long document line spans two consecutive visible ranges, producing stray "¬" glyphs. Switching to RangeSetBuilder (the standard CodeMirror idiom, as used in the adjacent indentGuides plugin) removes that risk entirely.

src/cm/lineBreakMarker.ts — the getDecorations method should use RangeSetBuilder instead of a plain array to avoid duplicate markers on long lines.

Important Files Changed

Filename Overview
src/cm/lineBreakMarker.ts New CodeMirror ViewPlugin rendering "¬" at each non-final line end; uses a raw array + Decoration.set instead of RangeSetBuilder, risking duplicate widgets on long lines that span two consecutive visible ranges.
src/lib/editorManager.js Adds lineBreakMarkerCompartment with keys ["showLineBreakMarker","textWrap"]; correctly rebuilds when either setting changes and hooks up the update listener. No issues found.
src/lib/settings.js Adds showLineBreakMarker defaulting to false; straightforward, no issues.
src/settings/editorSettings.js New setting entry with label and info strings correctly wired to the guidesIndicators category; both string keys now exist in en-us.json.
src/lang/en-us.json Adds both "show line break marker" label and "settings-info-editor-show-line-break-marker" info strings; type definition in index.d.ts updated to match.

Reviews (2): Last reviewed commit: "Merge branch 'main' into feature/line-br..." | Re-trigger Greptile

Comment thread local.properties Outdated
Comment on lines +1 to +8
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Mon May 25 14:58:09 IST 2026
sdk.dir=C\:\\Users\\jainy\\AppData\\Local\\Android\\Sdk
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Developer-specific file committed to version control

This file contains a machine-specific Windows SDK path (sdk.dir=C:\Users\jainy\...) and the file header itself says it "must NOT be checked into Version Control Systems." Even though /local.properties was correctly added to .gitignore in this PR, the file is still being committed. Any developer who checks out this branch will have their own local.properties overwritten with a path that doesn't exist on their machine, breaking their Android build setup.

Comment thread src/cm/lineBreakMarker.ts Outdated
Comment thread local.properties Outdated
UnschooledGamer and others added 3 commits May 26, 2026 09:12
@UnschooledGamer

This comment was marked as resolved.

@UnschooledGamer UnschooledGamer changed the title Add visual line break marker toggle feat: visual line break marker toggle May 26, 2026
@UnschooledGamer UnschooledGamer changed the title feat: visual line break marker toggle feat(editor): togglable visual line break marker May 26, 2026
@UnschooledGamer

This comment was marked as outdated.

@UnschooledGamer

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request translations Anything related to Translations Whether a Issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants